# vim: set filetype=python :
import os,sys

Import('env')
CPPPATH=env['CPPPATH'] + ['.']

# We'll use these as sources for all shared objects.  We turned off the
# duplicate environments warnings in order to do this
libsources = ['atlasImages.c',
              'dataIo.c',
              'dervish.c',
              'main.c',
              'main_mask.c',
              'phSpanUtil.c',
              'read.c',
              'rice.c',
              'write.c',
              'read_atlasUtil.c']

for name in ['read_atlasIDL','read_objmaskIDL','recframeIDL']:
    target='../DLM/'+name
    sources=[libsources,name+".c"],
    dlm=name+'.dlm'
    env.SharedLibrary(target=target,source=sources,
                      CCFLAGS=env['CFLAGS']+env['SDSS_CFLAGS'],
                      CPPPATH=CPPPATH,
                      SHLIBPREFIX='')
    env.Command("../DLM/"+dlm,dlm, Copy("$TARGET","$SOURCE"))
